<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Vue({ data }) {
        this._data = data;

        for (let key in this._data) {
          Object.defineProperty(this, key, {
            get: function proxyGetter() {
              return this._data[key];
            },
            set: function proxySetter(val) {
              this._data[key] = val;
            },
          });
        }
      }

      const vm = new Vue({
        data: {
          count: 1,
          price: 299,
        },
      });

      console.log(vm);
    </script>
  </body>
</html>
